package io.gitee.bluemiaomiao.dataanalyzebackend.controller;

import com.alibaba.fastjson.JSONObject;
import io.gitee.bluemiaomiao.dataanalyzebackend.domian.shop.ShopSmokeType;
import io.gitee.bluemiaomiao.dataanalyzebackend.domian.shop.number;
import io.gitee.bluemiaomiao.dataanalyzebackend.repos.StoreAnalysisMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 * @description 店铺类型分析
 */
@RestController
@RequestMapping(value = "/shop")
public class ShopTypeAnalysisController {

  @Autowired private StoreAnalysisMapper storeAnalysisMapper;

  @ResponseBody
  @RequestMapping(value = "/ShopSmokeType", method = RequestMethod.POST)
  public String smokeType(ShopSmokeType shopSmokeType) {
    List<number> a = storeAnalysisMapper.cxShopAndSmokeType(shopSmokeType);
    String json = JSONObject.toJSONString(a);
    return json;
  }

  @ResponseBody
  @RequestMapping(value = "/SmokeAllName", method = RequestMethod.POST)
  public String SmokeNumber() {
    //        and buy_datetime between  * and *
    List<number> a = storeAnalysisMapper.cxSmokeName();
    String json = JSONObject.toJSONString(a);
    return json;
  }

  @ResponseBody
  @RequestMapping(value = "/ShopSmokeVeLine", method = RequestMethod.POST)
  public String Smoke(ShopSmokeType shopSmokeType) {
    //        and buy_datetime between  * and *
    List<number> a = storeAnalysisMapper.cxShopAndSmokeTypeVeLine(shopSmokeType);
    String json = JSONObject.toJSONString(a);
    return json;
  }

  @ResponseBody
  @RequestMapping(value = "/ShopAndSmokeName", method = RequestMethod.POST)
  public String ShopAndSmokeName(ShopSmokeType shopSmokeType) {
    //        and buy_datetime between  * and *
    List<number> a = storeAnalysisMapper.cxShopAndSmokeName(shopSmokeType);
    String json = JSONObject.toJSONString(a);
    return json;
  }
}
